package com.babster631;

import javax.swing.text.html.parser.Entity;

import com.babster631folder2.babster631modbase;

import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import cpw.mods.fml.common.registry.GameRegistry;

public class util {
public static void recipes ()

{
	ItemStack diamond64 = new ItemStack(Item.diamond, 64);
	ItemStack dirt1 = new ItemStack(Block.dirt);
	ItemStack wood64 = new ItemStack(Block.wood, 64);
	ItemStack diamond1 = new ItemStack(Item.diamond);
	ItemStack enchantingbottle64 = new ItemStack(Item.expBottle, 64);
	ItemStack glassbottle1 = new ItemStack(Item.glassBottle);
	ItemStack sand64 = new ItemStack(Block.sand, 64);
	ItemStack sand1 = new ItemStack(Block.sand);
	ItemStack dragonegg = new ItemStack(Block.dragonEgg);
	ItemStack coal1 = new ItemStack(Item.coal);
	ItemStack cobblestone1 = new ItemStack(Block.cobblestone);
	ItemStack enderpearl16 = new ItemStack(Item.enderPearl, 16);
	ItemStack ironore1 = new ItemStack(Block.oreIron);
	ItemStack blazepowder64 = new ItemStack(Item.blazePowder, 64);
	ItemStack enchantingtable1 = new ItemStack(Block.enchantmentTable, 1);
	ItemStack seed1 = new ItemStack(Item.seeds, 1);
	ItemStack bookshelf = new ItemStack(Block.bookShelf, 64);
	ItemStack sign = new ItemStack(Item.sign);
	ItemStack arrow64 = new ItemStack(Item.arrow, 64);
	ItemStack torch64 = new ItemStack(Block.torchWood, 64);
	ItemStack stonebutton = new ItemStack(Block.stoneButton);
	
	GameRegistry.addShapelessRecipe(diamond64, dirt1);
	GameRegistry.addShapedRecipe(dragonegg,"x  ","y  ","   ",'x', coal1,'y', diamond1);
	GameRegistry.addShapelessRecipe(wood64, diamond1);
	GameRegistry.addSmelting(Item.glassBottle.itemID, enchantingbottle64, 100);
	GameRegistry.addShapelessRecipe(sand64, sand1);
	GameRegistry.addShapelessRecipe(enderpearl16, cobblestone1);
	GameRegistry.addShapelessRecipe(blazepowder64, ironore1);
	GameRegistry.addShapelessRecipe(enchantingtable1, seed1);
	GameRegistry.addShapelessRecipe(bookshelf, sign);
	GameRegistry.addShapelessRecipe(arrow64, dragonegg);
	GameRegistry.addShapelessRecipe(torch64, stonebutton);
	
	ItemStack EnderPearl = new ItemStack (Item.enderPearl);
	ItemStack IronIngot1 = new ItemStack(Item.ingotIron);
	ItemStack Diamond1 = new ItemStack(Item.diamond);
	ItemStack Stick = new ItemStack(Item.stick);
	ItemStack IronSword = new ItemStack(Item.swordIron);
	ItemStack IronAxe = new ItemStack(Item.axeIron);
	ItemStack IronPickaxe = new ItemStack(Item.pickaxeIron);
	ItemStack IronShovel = new ItemStack(Item.shovelIron);
	ItemStack IronHoe = new ItemStack(Item.hoeIron);
	ItemStack IronHelmet = new ItemStack(Item.helmetIron);
	ItemStack IronChestplate = new ItemStack(Item.plateIron);
	ItemStack IronLegs = new ItemStack(Item.legsIron);
	ItemStack IronBoots = new ItemStack(Item.bootsIron);
	
	ItemStack ThunderSword = new ItemStack(babster631modbase.thunderSword);
	ItemStack ThunderAxe = new ItemStack (babster631modbase.thunderaxe);
	ItemStack ThunderPickaxe = new ItemStack (babster631modbase.thunderpickaxe);
	ItemStack ThunderShovel = new ItemStack (babster631modbase.thunderspade);
	ItemStack ThunderHoe = new ItemStack (babster631modbase.thunderhoe);
	ItemStack ThunderIngot = new ItemStack(babster631modbase.thunderingot);
	ItemStack ThunderPearl4 = new ItemStack(babster631modbase.thunderpearl, 4);
	ItemStack ThunderHelmet = new ItemStack(babster631modbase.helmetthunder);
	ItemStack ThunderChestplate = new ItemStack(babster631modbase.chestplatethunder);
	ItemStack ThunderLegs = new ItemStack(babster631modbase.legsthunder);
	ItemStack ThunderBoots = new ItemStack(babster631modbase.bootsthunder);
	

	GameRegistry.addShapedRecipe(ThunderSword, " x "," x "," y ",'x',ThunderIngot, 'y', IronSword);
	GameRegistry.addShapedRecipe(ThunderAxe,"xx ","xy "," z ",'x', ThunderIngot,'y',IronAxe,'z',Stick);
	GameRegistry.addShapedRecipe(ThunderPickaxe,"xxx"," y "," z ", 'x',ThunderIngot,'y', IronPickaxe,'z',Stick);
	GameRegistry.addShapedRecipe(ThunderShovel," x "," y "," z ",'x', ThunderIngot,'y', IronShovel,'z', Stick);
	GameRegistry.addShapedRecipe(ThunderHoe," xx"," y "," z ",'x', ThunderIngot,'y',IronHoe,'z',Stick);
	GameRegistry.addShapedRecipe(ThunderIngot, " x ","xyx"," x ",'x', Diamond1,'y',IronIngot1);
	GameRegistry.addShapedRecipe(ThunderPearl4, " x ","xyx"," x ",'x', EnderPearl,'y',ThunderIngot);
	GameRegistry.addShapedRecipe(ThunderHelmet, "xzx","y y","   ",'x',ThunderIngot,'y',IronIngot1,'z',IronHelmet);
	GameRegistry.addShapedRecipe(ThunderChestplate, "y y","xzx","yyy",'x',ThunderIngot,'y',IronIngot1,'z',IronChestplate);
	GameRegistry.addShapedRecipe(ThunderLegs,"xzx","y y","y y",'x',ThunderIngot,'y',IronIngot1,'z',IronLegs);
	GameRegistry.addShapedRecipe(ThunderBoots,"   ","x x","yzy",'x',ThunderIngot,'y',IronIngot1,'z',IronBoots );
	
	}
	public static Vec3 placeInFrontOfEntity(net.minecraft.entity.Entity _entity, float meters )
	{
	        Vec3 ret = Vec3.createVectorHelper(0,0,0);
	        ret.xCoord = _entity.posX;
	        ret.yCoord = _entity.posY;
	        ret.zCoord = _entity.posZ;
	        float yaw = _entity.rotationYaw - 90;
	        ret.xCoord -= ((double)(MathHelper.cos(yaw/ 180.0F * (float)Math.PI))) * meters;
	        ret.zCoord -= ((double)(MathHelper.sin(yaw/ 180.0F * (float)Math.PI))) * meters;
	        return ret;
	}
    public static Vec3 placeInRandomDir(int x,int y, int z, float meters )
 {
         Vec3 ret = Vec3.createVectorHelper(0,0,0);
         ret.xCoord = x;
         ret.yCoord = y;
         ret.zCoord = z;
         float yaw = (float)Math.random()*360;
         ret.xCoord -= ((double)(MathHelper.cos(yaw/ 180.0F * (float)Math.PI))) * meters;
         ret.zCoord -= ((double)(MathHelper.sin(yaw/ 180.0F * (float)Math.PI))) * meters;
         return ret;
 }

}
